package com.air.ota.vo;

import com.air.common.util.CommonUtil;
import com.air.ota.util.HexStringUtil;
import com.air.ota.util.PBOCUtil;

public class UTKModifyPwdDownlinkVO extends UTKBaseDownlinkVO {
	
	protected byte[] cardAppSequence;
	protected byte   result;
	protected byte   descLength;
	protected byte[] desc;
	//protected byte[] cardRandom;
	//protected byte[] mac1;
	
	public UTKModifyPwdDownlinkVO(byte[] cardSequence,byte[] pkgSequence,
			byte[] cardAppSequence,byte result,byte[] desc){
		super(cardSequence,pkgSequence);
		this.cmdType = 20;
		
		this.cardAppSequence = cardAppSequence;
		this.result = result;
		if (desc==null){
			this.descLength = 0;
			this.desc = new byte[0];
		}else{
			this.descLength = (byte)desc.length;
			this.desc = desc;
		}
		
		/*this.cardRandom = CommonUtil.randomString(4).getBytes();
		
		byte[] dataToMac1 = new byte[10+desc.length];
		mac1 = makeMac1(this.cardSequence,cardRandom,dataToMac1);*/
		
		String cmdDataHexString=HexStringUtil.bytesToHexString(this.cardAppSequence)+
			HexStringUtil.byteToHexString(this.result)+
			HexStringUtil.byteToHexString(this.descLength)+
			HexStringUtil.bytesToHexString(this.desc)+
			//HexStringUtil.bytesToHexString(this.cardRandom)+
			//HexStringUtil.bytesToHexString(this.mac1)+
			HexStringUtil.bytesToHexString(this.pkgSequence);

		this.cmdData = HexStringUtil.hexStringToBytes(cmdDataHexString);
		
		
	}
	
	
	
}
